<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<title><s:property value="ev_title" /></title>
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}jp/1.css" />
<link rel="stylesheet" href="${aier_css_url}index/fam-user-mana.css" />
<link href="${aier_css_url}jc/chosen.css" rel="stylesheet">
<link href="${aier_css_url}jq/jq.css" rel="Stylesheet" />
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}/ui.css" />
<link rel="stylesheet" href="${aier_css_url}comm/text.css" />
<link rel="stylesheet" href="${aier_css_url}admin/admin.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/1.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/afu.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/hh/ui.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/arrayList.js"></script>
<script type="text/javascript" src="${aier_js_url}jc/cj.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}comm/text.js"></script>
</head>
<body style="background-color: #EEF2FB;">
    
    <div style="background-color: #EEF2FB;width: 100%;height: 700px; ">
       
                    <div id="tabs">
                    <ul>
                        <li><a href="#tabs-1">回收卡</a></li>
                    </ul>
                    <div id="tabs-1" style="height: 500px;">
                        <div class="d_content">这里是回收卡界面...
                        <s:action name="proxy_choice"
                                namespace="/zxadmin" executeResult="true"></s:action>
                        <button onclick="notAssignCard();"
                                class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                                role="button" aria-disabled="false">
                                <span class="ui-button-text">显示已分配的卡</span>
                            </button>
                        <div id="assigncard"></div>
                        <div id=icCdate class="jqpage"></div>
                            <div class="d_scnOut" style="margin-top: 20px;margin-left: -76px;">
                                <div class="d_scname">
                                    <label>head:</label>
                                </div>
                                <div class="d_sctext" >
                                    <input type="text" id="ichead" />
                                </div>
                            </div>
                            <div class="d_scnOut" style="margin-top: -40px;margin-left: 170px;">
                                <div class="d_scname">
                                    <label>icbody1:</label>
                                </div>
                                <div class="d_sctext" >
                                    <input type="text" id="icbody1" />
                                </div>
                            </div>
                            <div class="d_scnOut" style="margin-top: -40px;margin-left: 420px;">
                                <div class="d_scname">
                                    <label>icbody2:</label>
                                </div>
                                <div class="d_sctext" >
                                    <input type="text" id="icbody2" />
                                </div>
                            </div>
                            <button onclick="cardSearch();"
                                class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                                role="button" aria-disabled="false" style="margin-top: -80px;margin-left: 720px;">
                                <span class="ui-button-text">回收</span>
                            </button>
                            <p id="haveAssgin"></p>
				
				        </div>
				    </div>
				</div>

    </div>

	<script type="text/javascript">
	$("#tabs").tabs();
		//查询分配卡
		function notAssignCard(p) {
			if(isnull(s_pid)){
				$().message("请指定代理商！");
				return
			}
			var fun = function(data) {
				var t = "";
				for ( var i = 0; i < data.icCards.length; i++) {
					var ics = data.icCards[i];

					t += "<div>" + ics.ichead + ics.icbody + ics.icfoot
							+ "</div>";
				}
				$("#icCdate").pager({
					pagenumber : data.page,
					pagecount : data.page_count,
					buttonClickCallback : function(page) {
						notAssignCard(page);
					}
				});
				$("#assigncard").html(t);
			};

			exeAjax(
					ajaxUrl("${aier_url}${aier_urijs}adminrecover_searchAssignCard${aier_suffix}"),
					fun, {
						"page" : p,
						"pid" : s_pid,
					});
		}

		//回收代理商手里未分派的卡
		function cardSearch() {
			var fun = function(data) {

				if (data.s == 10001) {
					$().message("回收成功");
					var r = "<span>";
					for ( var i = 0; i < data.icCards.length; i++) {
						r += "<span>" + data.icCards[i].ichead
								+ "</span><span>" + data.icCards[i].icbody
								+ "</span><br>";
					}
					$("#haveAssgin").html(r);
				} else {
					$().message("回收失败");
				}
			};
			exeAjax(
					ajaxUrl("${aier_url}${aier_urijs}adminrecover_deleteProxyCard${aier_suffix}"),
					fun, {
						"ichead" : $("#ichead").val(),
						"icbody1" : $("#icbody1").val(),
						"icbody2" : $("#icbody2").val(),
						"pid" : s_pid,

					});
		}
	</script>
</body>
</html>